package com.pxene.dmp.common;

import com.pxene.dmp.constant.BaseConstant;

public class KVUrlGenerator {

	private static String getCustSign() throws Exception {
		return SAuthRss.getSign(BaseConstant.KV_USERNAME, UEncrypt.HASH_TYPE.MD5, 
				UEncrypt.getHash(UEncrypt.HASH_TYPE.MD5, BaseConstant.KV_PASSWORD), SAuthRss.SEED_TYPE.CURRENTDAY);
	}
	
	public static String getCustUrl(String apiName) throws Exception {
		return BaseConstant.KV_URL.replace("${apiname}", apiName)
				.replace("${username}", BaseConstant.KV_USERNAME)
				.replace("${sign}", getCustSign());
	}
	
	public static void main(String[] args) throws Exception {
		System.out.println(getCustSign());
	}
}
